<%@ page import="vo.Course" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
  Created by IntelliJ IDEA.
  User: ssw
  Date: 2018/6/12
  Time: 10:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生成绩管理系统v1.0</title>
</head>
<body>
欢迎您：${user.uname}(${user.uid})</br>
<h1>添加课程</h1>
<a href="/sgms/adminUI.jsp"> 回到上一页 </a></br>
已开设课程：</br>

<c:if test="${empty courseList}">
    <jsp:forward page="/askCourse"></jsp:forward>
</c:if>

<c:forEach items="${courseList}" var="course">
    ${course.cname}</br>
</c:forEach>

<form action="/addCourse">
    请输入课程名称<input type="text" name="cname"></br>
    <input type="submit" value="提交">
</form>
<%
    if(request.getParameter("res")!=null){
        if(request.getParameter("res").equals("1")){
            out.println("插入课程成功");
        }
        else{
            out.println("插入课程失败");
        }
    }
%>
</body>
</html>
